<?php
/*	function __autoload($class_name){
		$dirs = array(
			'Factories/',
			'cntrlr/',
			'mdl/',
			'mdl/Delete/',
			'mdl/Select/',
			'mdl/Update/',
			'mdl/Insert/',
			''
		);
		foreach($dirs as $dir){
			if(file_exists($dir.$class_name . '.php')){
				require_once($dir.$class_name . '.php');
				return;
			}
		}
		throw new BadFunctionCallException("No such Object file");
	}

	if (isset($_POST["logout"])){
		session_start();
		unset($_SESSION['login']);
		if (isset($_SESSION["order"]))
			unset($_SESSION["order"]);
		session_destroy();
	}
	if (session_status() == PHP_SESSION_NONE) {
		session_start();
		if (!isset($_SESSION["order"]))
			$_SESSION["order"]= new Order();
	}
//Front controler */
	include('vw/adminside/header.php');
	include('vw/adminside/content.php');
	include('vw/adminside/menuView.php');

/*	$dirs = array(
			'vw/userside/',
			'cntrlr/'
	);
		if(isset($_GET['page'])){
			$page = $_GET['page'];
			foreach($dirs as $dir){	

				if(file_exists($dir. $page . '.php')){
					$page=$dir.$page;
					break;
				}
			}

			if (strcmp($_GET['page'], $page)==0){
				$page="cntrlr/mainpage";
			}
		} else {
			$page = 'cntrlr/mainpage';
		}
	
	include ($page . '.php');
	include('vw/userside/footer.php');*/
	include('vw/adminside/footer.php');
?>